################################################################################
#
# Chris Rigg
# Sam Strom
#
# ECEN 5033 - Extended Robotics Lab
#
# Spring 2008
#

TOP_DIR  := .

# One instance, accomplished via $(sort), of each immediate
# subdirectory, accomplished via $(dir), containing one or more
# makefiles (e.g., files named Makefile, makefile, and GNUmakefile),
# accomplished via $(shell ls */*akefile):
#
SUBDIRS := $(sort $(dir $(shell ls */*akefile)))

# Mark the subdirectories as phony to ensure that their makefiles always get
#   executed.
#
.PHONY: all install clean $(SUBDIRS)

all: $(SUBDIRS)

# Execute the makefile in the module subdirectory
#
$(SUBDIRS):
	$(MAKE) --directory=$@

install:
	for d in $(SUBDIRS);               \
  do                                 \
    $(MAKE) --directory=$$d install; \
  done

clean:
	for d in $(SUBDIRS);             \
  do                               \
    $(MAKE) --directory=$$d clean; \
  done
